home *** CD-ROM | disk | FTP | other *** search
/ Night Owl 6 / Night Owl's Shareware - PDSI-006 - Night Owl Corp (1990).iso / 013a / mexlas.zip / TXCLNDAR.PRG < prev    next >
Text File  |  1991-09-01  |  3KB  |  129 lines

  1. *:*********************************************************************
  2. *:
  3. *:        Program: TXCLNDAR.PRG
  4. *:
  5. *:         System: Texas Associated Software Laser Library
  6. *:         Author: Jose E. Lopez, Jr.
  7. *:      Copyright (c) 1991, Texas Associated Software - Red Oak, TX
  8. *:
  9. *:*********************************************************************
  10.  
  11. * There are many ways to code this example. This example is coded simply
  12. * to show the use of The Library not TexAS coding style. Thanks - JEL
  13.  
  14. txinit(_print_port)
  15. txreset()
  16. txpagesize("letter")
  17. txorient("L")
  18. txsetlpi(6)
  19.  
  20. txcolbox(01, 01, 105, 44, 1)    && DRAW CALENDAR BORDER
  21.  
  22. txcolbox(01, 01, 105, 02, 1)    && DRAW BORDER FOR MONTH NAME
  23. _month = cmonth(Date())         && CHARACTER MONTH NAME
  24. _year  = str(year(Date()),4)    && CHARACTER YEAR
  25. _mo_yr = _month + " " + _year
  26. _col   = (105 - len(Alltrim(_mo_yr))) / 2
  27. txcolprint(02, _col, .t., _mo_yr)
  28.  
  29. txcolprint(04, 05, .t., "Sunday")
  30. txcolprint(04, 20, .t., "Monday")
  31. txcolprint(04, 35, .t., "Tuesday")
  32. txcolprint(04, 48, .t., "Wednesday")
  33. txcolprint(04, 63, .t., "Thursday")
  34. txcolprint(04, 80, .t., "Friday")
  35. txcolprint(04, 94, .t., "Saturday")
  36.  
  37. DECLARE week1_[7], week2_[7], week3_[7], week4_[7], week5_[7]
  38. for i = 1 to 5
  39.    _array = "week"+str(int(i),1)+"_"
  40.    for i2 = 1 to 7
  41.       &_array[i2] = " "
  42.    Next
  43. Next
  44.  
  45. txcolbox(03, 01, 105, 02, 1, 10) && DRAW BORDER FOR DAYS OF WEEK
  46.  
  47. for i = 13 to 103 step 15
  48.    for X = 05 to 40 step 8
  49.       txcolbox(X, i, 03, 02, 1) && DRAW DAY OF MONTH BOX
  50.    Next
  51. Next
  52.  
  53. for i = 1 to 105 step 15
  54.    txcolbox(03, i, 15, 02, 1)   && DRAW DAY DIVIDING COLUMNS
  55.    txcolbox(05, i, 15, 40, 1)   && DRAW DAY DIVIDING COLUMNS
  56. Next
  57.  
  58. for i = 5 to 40 step 8
  59.    txcolbox(i, 01, 105, 8, 1)   && DRAW DAY DIVIDING ROWS
  60. Next
  61.  
  62. _bom   = day(Date() - day(Date()) + 1)
  63. _bdom  = Date() - day(Date()) + 1
  64. _bndom = dow(_bdom)
  65.  
  66. if month(Date()) = 12           && CHECK FOR DECEMBER
  67.    _eom = ctod("01/01" + substr(str(year(Date()) + 1, 4), 3, 2) - 1)
  68. else
  69.    _eom = substr(str(month(Date()) + 1, 2), 1, 2)
  70.    _eom = _eom + "/01/" + substr(str(year(Date()), 4), 3, 2)
  71.    _ndays = day(ctod(_eom) - 1)
  72.    _deom = ctod(_eom) - 1
  73. endif
  74.  
  75. i = 1
  76. for i2 = _bndom to 7
  77.    week1_[i2] = str(i, 2)
  78.    i = i + 1
  79. Next
  80. for i2 = 1 to 7
  81.    week2_[i2] = str(i, 2)
  82.    i = i + 1
  83. Next
  84. for i2 = 1 to 7
  85.    week3_[i2] = str(i, 2)
  86.    i = i + 1
  87. Next
  88. for i2 = 1 to 7
  89.    if i <= _ndays
  90.       week4_[i2] = str(i, 2)
  91.    endif
  92.    i = i + 1
  93. Next
  94.  
  95. if i <= _ndays
  96.    for i2 = 1 to 7
  97.       if i <= _ndays
  98.          week5_[i2] = str(i, 2)
  99.       endif
  100.       i = i + 1
  101.    Next
  102. endif
  103.  
  104. if i <= _ndays
  105.    for i2 = 1 to 7
  106.       if i <= _ndays
  107.          week1_[i2] = str(i, 2)
  108.       endif
  109.       i = i + 1
  110.    Next
  111. endif
  112.  
  113. i2 = 1
  114. for i = 6 to 42 step 8
  115.    _array = "week"+str(int(i2),1)+"_"
  116.    txcolprint(i, 13, .t., &_array[1])
  117.    txcolprint(i, 28, .t., &_array[2])
  118.    txcolprint(i, 43, .t., &_array[3])
  119.    txcolprint(i, 58, .t., &_array[4])
  120.    txcolprint(i, 73, .t., &_array[5])
  121.    txcolprint(i, 88, .t., &_array[6])
  122.    txcolprint(i,103, .t., &_array[7])
  123.    i2 = i2 + 1
  124. Next
  125.  
  126. txclear()
  127.  
  128. *: EOF: TXCLNDAR.PRG
  129.